package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject{

    private Long destId = -1L;
    //出行天数'
    private int dayType=-1;

    //月份
    private int travelTimeType=-1;

    //人均
    private int perExpendType = -1;

    private int orderType=1;//最新

    public String getOrderBy(){
        return orderType==1?"t.createTime desc" :"t.viewnum desc";
    }

    //开始映射
    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAY.get(dayType);
    }

    public TravelCondition getTravelTime(){
        return TravelCondition.TIMEMAP.get(travelTimeType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.PRE_EXPENDSMAP.get(perExpendType);
    }



}
